package wifiunion.com.notice.presenter;

import android.content.Context;

import java.util.HashMap;

import wifiunion.com.notice.NoticeContact;
import wifiunion.com.notice.NoticeModel;

/**
 * Created by Administrator on 2017/3/7.
 */

public class NoticeCopyPresenter implements NoticeContact.Presenter,NoticeContact.Callback{

    private NoticeContact.CopyNoticeView mView;
    private Context mContext;
    private NoticeModel mModel;


    private HashMap<String,Object> param = new HashMap<>();

    private int mType;


    public NoticeCopyPresenter(Context context, NoticeContact.CopyNoticeView view) {
        mView = view;
        mContext = context;
        mModel = new NoticeModel();
//        mView.setPresenter(this);
    }

    public void setType(int type)
    {
        this.mType = type;
    }


    @Override
    public void onSuccess(Object data) {

        mView.onCopyNoticeSuccess();
    }

    @Override
    public void onServerFailed(Object errorObj) {
        mView.onCopyNoticeFailed(errorObj);
    }

    @Override
    public void onNetFailed() {
        mView.onCopyNoticeFailed("网络异常");
    }

    @Override
    public void start() {
        HashMap<String, Object> params = new HashMap<String, Object>();

    }

    @Override
    public void start(HashMap<String, Object> params) {

    }


    public void copyNotice(HashMap<String, Object> params)
    {
        mModel.copyNotice(params, this,mType);
    }


}

